﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<title></title>
<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
<div class="box box-primary" id="more" style="width:110px;height:35px;background-color:#222c32;position:absolute;z-index:9999;left:850px;top:100px;display:none;font-size:12px;border-top-color:#222c32;">
            <div class="box-body home-message" id="moreOp" >
            </div>
        </div>
	<section class="content-header">
		<h1><spring:message code="message.listForm.yaoPinMuLu"/><spring:message code="message.jqGrid.cz.xiangQing"/></h1>
		<ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.StdManage"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.drugcatalogStd"/></a></li>
        </ol>
	</section>
	<section class="content">
		  <div class=" box box-success">
				<div class="box-body">
					<form action="${ctx}/produceDrugcatalog/exportExcel.html" id="exportExcel" method="post">
		            <input id="fileName" name="fileName" type="hidden" value="${fileName}" />
		            <input type="hidden" name="drugcatalogId" value="${drugcatalogId}"/> 
					<div class="input">
					
							<div class="textalign1"><spring:message code="message.listForm.fenLeiMingCheng"/><spring:message code="message.yanZheng.maoHao"/></div>
		                    <div class="boxinput">
		                        <input type="text" class="textinput" id="qualityspecClass" name="qualityspecClass"  placeholder="<spring:message code="message.listForm.fenLeiMingCheng"/>" />
		                    </div>
		                    
		                    <div class="textalign1"><spring:message code="message.listForm.pinZhongXuHao"/><spring:message code="message.yanZheng.maoHao"/></div>
		                    <div class="boxinput">
		                        <input type="text" class="textinput" id="qualityspecIndex" name="qualityspecIndex"  placeholder="<spring:message code="message.listForm.pinZhongXuHao"/>" />
		                    </div>
		                    
		                    <div class="textalign1"><spring:message code="message.listForm.yaoPinBianMa"/><spring:message code="message.yanZheng.maoHao"/></div>
		                    <div class="boxinput">
		                        <input type="text" class="textinput" id="qualityspecCode" name="qualityspecCode"  placeholder="<spring:message code="message.listForm.yaoPinBianMa"/>" />
		                    </div>
		                    
				    </div>
		            <div class="input" style="margin-top:3px">
		            
		                    <div class="textalign1"><spring:message code="message.listForm.tongYongMing"/><spring:message code="message.yanZheng.maoHao"/></div>
		                    <div class="boxinput">
		                        <input type="text" class="textinput" id="qualityspecName" name="qualityspecName"  placeholder="<spring:message code="message.listForm.tongYongMing"/>" />
		                    </div>
	                    	
	                    	<div class="textalign1" >
	                           <input type="button" id="selectDicCompType" onclick="likeQuery();" class="btn btn-success btn-sm" value="<spring:message code="message.button.seachSpacing"/>">
	                       </div>
	                       
	               </div>
	               </form>
             </div>
        </div>
		<table class="jqgrid" id="gridlist"></table>
		<div id="gridpage"></div>
		<div class=" box box-warning bottongroup">
			<label onclick="exportExcel();" class="btn btn-default btn-sm"><spring:message code="message.lable.daoChu"/></label>
			<label id="allOk" class="btn btn-default btn-sm" onclick='javascript:history.go(-1)'><spring:message code="message.button.getBackSpacing"/></label>
		</div>

    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
    
        $(function () {
        	
          //加载页面光标在名字框内，位于第一个
            $("#qualityspecClass").focus();
            
          //绑定回车      
            $('#qualityspecClass,#qualityspecIndex,#qualityspecCode,#qualityspecName').bind('keydown', function(event) {
                if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
                    $('#selectDicCompType').click();
                }
            }); 
        	
        	
            $("#gridlist").jqGrid({
                url: "getStdDrugcatalogDetailInfo.html?drugcatalogId=${drugcatalogId}",
                mtype: "POST",
                datatype: "json",
                autowidth: true,
                height: 270,                   	
                colNames: [
                           '<spring:message code="message.listForm.yaoPin"/>id',
                           '<spring:message code="message.listForm.fenLeiMingCheng"/>',
                           '<spring:message code="message.listForm.pinZhongXuHao"/>',
                           '<spring:message code="message.listForm.yaoPinBianMa"/>',
                           '<spring:message code="message.listForm.tongYongMing"/>',
                           '<spring:message code="message.listForm.jiXing"/>',
                           '<spring:message code="message.listForm.guiGe"/>'
                           ],
                colModel: [
						{ name: 'qualityspecId',hidden:true, width: "0%",align: 'center',sortable: false},		
						{ name: 'qualityspecClass', width: "20%",align: 'center',sortable: false},
						{ name: 'qualityspecIndex', width: "20%",align: 'center',sortable: false},
						{ name: 'qualityspecCode', width: "20%",align: 'center',sortable: false},
						{ name: 'qualityspecName', width: "20%",align: 'center' ,sortable: false},
						{ name: 'formName', width: "20%",align: 'center',sortable: false},
						{ name: 'specName', width: "20%",align: 'center',sortable: false}
					
                ],
                rowNum: 20,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                pager: "#gridpage",
                viewrecords: true,
                caption: "<spring:message code="message.listForm.yaoPin"/><spring:message code="message.listForm.lieBiao"/>-${drugcatalogName}", 
              //序号宽度自动变化
                gridComplete:function(){
                    //序号列宽度自适应（参数为jqgridID）
                    autoRNWidth("gridlist");
                    //数据只有一条时默认选中（参数为jqgridID）
                    selectByOneData("gridlist");
                },
                jsonReader: {
                	repeatitems: false,
                	id: "compRegId"
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
        });
        
        function likeQuery(){
        	var qualityspecClass  = $.trim($("#qualityspecClass").val());
            var qualityspecIndex = $.trim($("#qualityspecIndex").val());
            var qualityspecCode = $.trim($("#qualityspecCode").val());
            var qualityspecName = $.trim($("#qualityspecName").val());
	       	$("#gridlist").jqGrid('setGridParam', {
	       		mtype:"post",
	       		postData:{
	       			"qualityspecClass":qualityspecClass,
	       			"qualityspecIndex":qualityspecIndex,
	       			"qualityspecCode":qualityspecCode,
	       			"qualityspecName":qualityspecName,
	       		},
	       	    page: 1 
	       }).trigger("reloadGrid");
       }
        
        
      //导出
        function exportExcel(){
	         $("#exportExcel").submit();
    	} 
        
    </script>
</body>
</html>